//
//  DDIntervitedService.m
//  DingDongZP
//
//  Created by 杨政涛 on 16/10/28.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

#import "DDIntervitedService.h"

@implementation DDIntervitedService


- (void)sendInterviewType:(NSString *)interviewType  withState:(NSString *)state withInterViewID:(NSString *)interviewID withJob_id:(NSString *)job_id withEmplyoer_id:(NSString *)emplyoer_id withJobfinder_id:(NSString *)jobfinder_id withInterviewdt:(NSString *)interviewdt withLink_mobile:(NSString *)link_mobile withAddress:(NSString *)address withRemark:(NSString *)remark SuccessBlock:(successBlock)successBlock failBlock:(faileBlock)failBlock
{

    NSString *URLString = [[DDAPIGenerate sharedInstance] NewAPI:@"interview.php?act=saveInterview"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (!params[@"interviewType"]) {
        [params setObject:interviewType forKey:@"type"];
    }
    if (!params[@"state"]) {
        [params setObject:state forKey:@"state"];
    }
    if (!params[@"id"]) {
        [params setObject:interviewID forKey:@"id"];
    }
    if (!params[@"job_id"]) {
        [params setObject:job_id forKey:@"job_id"];
    }
    if (!params[@"emplyoer_id"]) {
        [params setObject:emplyoer_id forKey:@"emplyoer_id"];
    }
    if (!params[@"jobfinder_id"]) {
        [params setObject:jobfinder_id forKey:@"jobfinder_id"];
    }
    if (!params[@"interviewdt"]) {
        [params setObject:interviewdt forKey:@"interviewdt"];
    }
    if (!params[@"link_mobile"]) {
        [params setObject:link_mobile forKey:@"link_mobile"];
    }
    if (!params[@"address"]) {
        [params setObject:address forKey:@"address"];
    }
    if (!params[@"remark"]) {
        [params setObject:remark forKey:@"remark"];
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];

}


- (void)replayInterViewID:(NSString *)interviewID withState:(NSString *)state SuccessBlock:(successBlock)successBlock failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] NewAPI:@"interview.php?act=saveInterview"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (!params[@"id"]) {
        [params setObject:interviewID forKey:@"id"];
    }
    
    if (!params[@"state"]) {
        [params setObject:state forKey:@"state"];
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];

}

- (void)postInterviewRulesSuccessBlock:(successBlock)successBlock failBlock:(faileBlock)failBlock{

    NSString *URLString = [[DDAPIGenerate sharedInstance] NewAPI:@"interview.php?act=prePayRule"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
    
}

- (void)prePayInterviewWithInterviewID:(NSString *)interviewID SuccessBlock:(successBlock)successBlock failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] NewAPI:@"interview.php?act=prePayInterview"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (!params[@"id"]) {
        [params setObject:interviewID forKey:@"id"];
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

@end
